﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Script.Net.Scripts
{
	public static class ScriptFactory
	{
		private static IScriptRepository _repository = null;



		public static IScriptRepository Repository
		{
			get
			{
				if (_repository == null)
				{
					lock (typeof(IScriptRepository))
					{
						if (_repository == null)
							_repository = new HttpContextScriptRepository();
					}
				}

				return _repository;
			}
			set
			{
				if (_repository == value)
					return;

				lock (typeof(IScriptRepository))
				{
					if (_repository != value)
						_repository = value;
				}
			}
		}



	}
}
